import { http } from "@/utils/http";

type Result = {
  success: boolean;
  data: Array<any>;
};

export const getMyReport = id => {
  return http.request<Result>("get", "/my-report", {
    params: { id }
  });
};

export const uploadByServer = data => {
  return http.request<Result>(
    "post",
    "/upload",
    {
      data
    },
    { headers: { "Content-Type": "multipart/form-data" } }
  );
};
export const getReports = () => {
  return http.request<Result>("get", "/reports");
};

export const getReport = filename => {
  return http.request<Result>("get", "/report?filename=" + filename);
};
